package com.ztmg.water.controller.wxapi.order;

import com.ztmg.common.util.resultUtils.JsonResult;
import com.ztmg.water.dto.order.OrderPayDTO;
import com.ztmg.water.dto.order.OrderWaterDTO;
import com.ztmg.water.dto.order.OrderWaterTickDTO;
import com.ztmg.water.service.order.OrderWaterService;
import com.ztmg.water.service.order.OrderWaterTickService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(description = "订单对外接口")
@RestController
@RequestMapping("api/order")
public class OrderController {
    @Resource
    private OrderWaterService orderWaterService;
    @Resource
    private OrderWaterTickService orderWaterTickService;

    @ApiOperation("桶装水订单信息")
    @GetMapping("water")
    public JsonResult getWaterOrder(){
        return null;
    }
    @ApiOperation("水票订单信息")
    @GetMapping("ticet")
    public JsonResult getTicetOrder(){
        return null;
    }
    @ApiOperation("桶装水下单")
    @PostMapping("water/create")
    public JsonResult createWaterOrder(OrderWaterDTO dto){

        return orderWaterService.create(dto);
    }
    @ApiOperation("水票下单")
    @PostMapping("ticet/create")
    public JsonResult createTicetOrder(OrderWaterTickDTO dto){
        return orderWaterTickService.create(dto);
    }
    @ApiOperation("支付回调")
    @PostMapping("payBackCall")
    public JsonResult payBackCall(OrderPayDTO dto){
        return orderWaterService.toPay(dto);
    }

}
